home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Jul 89 / W0102-MacApp 2.0b9 CanDis-Jul89 < prev    next >
Encoding:
Text File  |  1989-08-22  |  2.2 KB  |  61 lines  |  [TEXT/GEOL]

  1. Item    7442823                         21-July-89        07:26
  2.  
  3. From:   AU0008                          Kopfwerk EDV SW Entwicklung
  4.  
  5. To:     MACAPP.TEST                     MacApp SQA Team
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    MacApp 2.0b9 CanDismiss bug
  10.  
  11. Dear colleagues,
  12. I found a bug in real-b9 (also in 8.2): You can accept a dialog with a
  13. deactivated and dimmed "OK" button (more correct: fDefaultItem) with the return
  14. key.
  15. e.g. in a find dialog deactivate the "Find" button if there is no string.
  16. The "changed list" says it is fixed and it is true that CanDismiss tests for
  17. IsViewEnabled, but it doesn´t use the result.
  18.  
  19. ##########################################################################
  20. FUNCTION TDialogView.CanDismiss(dismissing: IDType): BOOLEAN;
  21.  
  22.    VAR
  23.       dismissingView:    TView;
  24.       aBool:             BOOLEAN;   (* new *)
  25.  
  26. BEGIN
  27.    { First, make sure the view initiating the dismissal, if any, is enabled. }
  28.  
  29.    IF LONGINT(dismissing) <> LONGINT(kNoIdentifier) THEN
  30.       dismissingView := FindSubView(dismissing)
  31.    ELSE
  32.       dismissingView := NIL;                     { no dismissing view }
  33.  
  34.    (* when dismissing <> fCancelItem ->                     *)
  35.    (* CanDismiss will be true regardless of IsViewEnabled   *)
  36.    (* 7/20/89 by Tommi GESSL, KOPFWERK                      *)
  37. {$IFC FALSE}
  38.    CanDismiss := (dismissingView = NIL) | (dismissingView.IsViewEnabled);
  39. {$ELSEC}
  40.    aBool := (dismissingView = NIL) | (dismissingView.IsViewEnabled);
  41.    CanDismiss:= aBool;
  42.  
  43.    if aBool then   (* test only we haven´t failed *)
  44. {$ENDC}
  45.       { Now, if we're not cancelling, make sure the current edit text is
  46.         valid and return false if it isn't.}
  47.       IF (LONGINT(fCancelItem) = LONGINT(kNoIdentifier)) |
  48.                                         (dismissing <> fCancelItem) THEN
  49.       BEGIN
  50.                        { Attempt to deselect current edit text }
  51.          DoSelectEditText(NIL, False);
  52.                        { Successful only if it was deselected }
  53.          CanDismiss := fCurrentEditText = NIL;
  54.       END;
  55. END;
  56. ##########################################################################
  57.  
  58. sincerly,
  59. Tommi, KOPFWERK SW Dev.
  60.  
  61.